package com.tarena.baking.controller;

import com.tarena.baking.mapper.CategoryMapper;
import com.tarena.baking.pojo.vo.CategoryVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


@RestController
@RequestMapping("/api/category")
public class CategoryController {

    @Autowired
    private CategoryMapper categoryMapper;

    @GetMapping("getCategoryListByType")
    public List<CategoryVO> queryCategoryListByType(Integer type) {
        return categoryMapper.selectByType(type);
    }
}
